<{include file="public/header.html"}>

<FORM name="ff" method="post" onsubmit="selectOK();return false;">
<input type="hidden" name="strAction" value="">
<input type="hidden" name="strOrderNumb" value="<{ $curOrderNumb }>">

<TABLE class="box" align="center" width="99%" border="0">
<TR><TD>
    <table id="tbl" border="0" width="100%" cellpadding='0' cellSpacing="0">
    <TR><TD class="menubox" align="center" colspan="9"><br/>
        <font size="+1">设置新任务的添加位置</font><br/><br/>
    </TD></TR>
    </table>
</td></tr>
<tr>
    <td align="center"><!--begin page info-->
    <table border="0" width="100%" cellpadding='0' cellSpacing="0">
    <tr><td align="right">新任务添加位置：</td>
    <td>
    <select name="strTaskWhere" onchange="chgOrderNumb();" title='设置新任务在当前选择任务的位置'>
       <option value='after' selected>当前任务之后</option>
       <option value='before'>当前任务之前</option>
       <option value='inside'>当前任务的子任务</option>
       <option value='last'>最后位置</option>
    </select>
    </td></tr>
    <tr><td align="right">新任务序号：</td>
    <td><input type="text" name="strNewOrderNumb" size="12" maxlength="10" class="TEXT_NUMB" style="ime-mode:disabled;" 
        value="<{ $curOrderNumb }>" readOnly>
    </td></tr>
    <tr><td colspan="2"><br/>
        [注]序号为空时，新任务则添加到最后位置
    </td></tr>
    </table>
    </td>
</tr>
</TABLE>
<div align="right">
    <input type="submit" name="btnOK" value="确 定" > &nbsp; 
    <input type="button" name="btnCa" value="取 消" onclick="selectCancel();"> &nbsp; 
</div>
</FORM>

<script language="javascript">
<!--
function selectOK() {
    var sValue = ff.strTaskWhere.value + "**" + ff.strNewOrderNumb.value;
	window.returnValue = sValue;
	window.close();
}
function selectCancel() {
	window.returnValue = "";
	window.close();
}
function chgOrderNumb() {
    var curOrderNumb = 0;
    if (ff.strNewOrderNumb.value == "") {
        return false;
    } else {
        curOrderNumb = parseInt(ff.strOrderNumb.value,10);
        if (ff.strTaskWhere.value == 'after' || ff.strTaskWhere.value == 'inside') {
            ff.strNewOrderNumb.value = curOrderNumb + 1;
        } if (ff.strTaskWhere.value == 'before') {
            ff.strNewOrderNumb.value = (curOrderNumb<=1 ? 1 : curOrderNumb - 1);
        } if (ff.strTaskWhere.value == 'last') {
            ff.strNewOrderNumb.value = '';
        }
    }
}
chgOrderNumb();
//-->
</script>

<{include file="public/footer.html"}>